/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.com.minam.beans;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alvaro
 */
@Entity
@Table(name = "SCATBP_VARIABLE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ScatbpVariable.findAll", query = "SELECT s FROM ScatbpVariable s"),
    @NamedQuery(name = "ScatbpVariable.findByIdVar", query = "SELECT s FROM ScatbpVariable s WHERE s.idVar = :idVar"),
    @NamedQuery(name = "ScatbpVariable.findByVNomVar", query = "SELECT s FROM ScatbpVariable s WHERE s.vNomVar = :vNomVar"),
    @NamedQuery(name = "ScatbpVariable.findByVNomCorto", query = "SELECT s FROM ScatbpVariable s WHERE s.vNomCorto = :vNomCorto"),
    @NamedQuery(name = "ScatbpVariable.findByIdUnd", query = "SELECT s FROM ScatbpVariable s WHERE s.idUnd = :idUnd")})
public class ScatbpVariable implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_VAR")
    private BigDecimal idVar;
    @Size(max = 50)
    @Column(name = "V_NOM_VAR")
    private String vNomVar;
    @Size(max = 30)
    @Column(name = "V_NOM_CORTO")
    private String vNomCorto;
    @Column(name = "ID_UND")
    private BigInteger idUnd;

    public ScatbpVariable() {
    }

    public ScatbpVariable(BigDecimal idVar) {
        this.idVar = idVar;
    }

    public BigDecimal getIdVar() {
        return idVar;
    }

    public void setIdVar(BigDecimal idVar) {
        this.idVar = idVar;
    }

    public String getVNomVar() {
        return vNomVar;
    }

    public void setVNomVar(String vNomVar) {
        this.vNomVar = vNomVar;
    }

    public String getVNomCorto() {
        return vNomCorto;
    }

    public void setVNomCorto(String vNomCorto) {
        this.vNomCorto = vNomCorto;
    }

    public BigInteger getIdUnd() {
        return idUnd;
    }

    public void setIdUnd(BigInteger idUnd) {
        this.idUnd = idUnd;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idVar != null ? idVar.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ScatbpVariable)) {
            return false;
        }
        ScatbpVariable other = (ScatbpVariable) object;
        if ((this.idVar == null && other.idVar != null) || (this.idVar != null && !this.idVar.equals(other.idVar))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.com.minam.beans.ScatbpVariable[ idVar=" + idVar + " ]";
    }
    
}
